package com.morning.aiagentbackend.controller;

import jakarta.annotation.Resource;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/test")
public class TestController {

    @Resource
    private ChatModel dashscopeChatModel;


    @GetMapping("/dashscope")
    public String test(@RequestParam String text) {
        String call = dashscopeChatModel.call(text);
        return call;
    }

}
